package model;
import model.base.BaseMonitoringFactor;

@SuppressWarnings("serial")
public class MonitoringFactor extends BaseMonitoringFactor<MonitoringFactor> {
    public static final MonitoringFactor dao = new MonitoringFactor().dao();
    

	public MonitoringFactor findFirstByStationIdAndFactor(Long stationId , String factor){
        return this.findFirst(" SELECT tmf.* FROM t_monitoring_factor tmf WHERE tmf.stationId = ? AND tmf.factor = ?  LIMIT 1 " , stationId , factor);
    }

	public boolean isRepeatStationId(){
		MonitoringFactor ex = MonitoringFactor.dao.findFirstByStationIdAndFactor( getStationId() , getFactor() );
		return ( null == getId() && null != ex) || (null != ex && !ex.getId().equals(getId()));
	}
}
